package com.xr.blackhoole.mvc.configuration;

import com.xr.blackhoole.mvc.interceptor.MvcWormholeWebInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 将我们写的拦截器注入到MVC中，并设置需要拦截的路径
 */
public class BlackMVCConfiguration implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addWebRequestInterceptor(new MvcWormholeWebInterceptor()).addPathPatterns("/**");
    }
}
